import com.alibaba.fastjson.{JSON, JSONObject}
import org.apache.spark.sql.SparkSession
import org.elasticsearch.spark._

/**
  * @ Auther: o2o-rd-0008
  * @ Date:   2020/8/4 11:27
  * @ Param:  ${PARAM}
  * @ Description: 
  */
object ChangeTaobaoPrice {
  def main(args: Array[String]): Unit = {
    val spark: SparkSession = SparkSession.builder()
      .appName("SparkTest")
      .master("local[*]")
      .config("es.nodes", "192.168.1.29")
      .config("es.port", "9200")
      .config("cluster.name", "O2OElastic")
      .config("es.net.http.auth.user", "elastic")
      .config("es.net.http.auth.pass", "changeme")
      .getOrCreate()

    val sc = spark.sparkContext
    sc.hadoopConfiguration.set("fs.s3a.access.key", "GAO7EO9FWKPJ8WFCQDME")
    sc.hadoopConfiguration.set("fs.s3a.secret.key", "LZ0xaHBSYKHaJ9ECDbX9f7zin79UZkXfGoNapRPL")
    sc.hadoopConfiguration.set("fs.s3a.endpoint", "https://obs.cn-north-1.myhuaweicloud.com")
    sc.setLogLevel("WARN")

    val year = 2021
    val month = 3
    val index = s"${year}_tmall/tmall_${year}_${month}"

    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "shopName": "居然之家官方旗舰店"
        |    }
        |  }
        |}
        |
        |
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)

      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      val commentCount = nObject.getInteger("commentCount")

      /*if (sellCount>9000){
        nObject.put("sellCount",commentCount)
        nObject.put("salesAmount",commentCount*priceText)
      }*/

     /* if (sellCount>40000){
//        nObject.put("priceText",priceText/1000)
                nObject.put("sellCount",sellCount/100)
        nObject.put("salesAmount",(sellCount/100)*(priceText))
      }*//*else  if (sellCount>20000){
        nObject.put("sellCount",sellCount-20000)
        nObject.put("salesAmount",(sellCount-20000)*(priceText))
      }*/
//      nObject.put("priceText",priceText/10)
//      nObject.put("salesAmount",sellCount*(priceText/10))
//      nObject.put("priceText",1)
//      nObject.put("salesAmount",sellCount*(1))
//      nObject.put("sellCount",2300)
//      nObject.put("salesAmount",2300*priceText)
      /*if (priceText == 888){
        nObject.put("priceText",328.0)
        //                nObject.put("sellCount",sellCount/100)
        nObject.put("salesAmount",sellCount*(328.0))
      }*/
      /*if (priceText > 100 && priceText < 300){
        nObject.put("priceText",priceText-100.0)
//                nObject.put("sellCount",sellCount/100)
        nObject.put("salesAmount",sellCount*(priceText-100.0))
      }*/

      if (priceText>10000){
        nObject.put("priceText",priceText/100)
//        nObject.put("sellCount",sellCount/100)
        nObject.put("salesAmount",sellCount*(priceText/100))
      }else if (priceText<10000 && priceText>900){
        nObject.put("priceText",priceText/10)
        //        nObject.put("sellCount",sellCount/100)
        nObject.put("salesAmount",sellCount*(priceText/10))
      }

      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))


    //      nObject.put("province","香港特别行政区")
    //      nObject.put("name","阿里健康信息技术有限公司")
    //      nObject.put("address","香港铜锣湾勿地臣街1号时代广场1座26楼")
    //      nObject.put("administrative_region","华南地区")
    //      nObject.put("city","0")
    //      nObject.put("latitude","32.498658")
    //      nObject.put("longitude","80.100632")
    //      nObject.put("regional_ID","810000")
    //      nObject.put("registration_institution","阿里地区市场监督管理局")

    /*println("小CK时尚包店")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "shopName": "小CK时尚包店"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>100){
        nObject.put("priceText",priceText-100.0)
        nObject.put("salesAmount",sellCount*(priceText-100.0))
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))

    println("宅鱼水族官方企业店")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "shopName": "宅鱼水族官方企业店"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>100){
        nObject.put("priceText",9.0)
        nObject.put("salesAmount",sellCount*9.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))

    println("d[s104367096]")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "shopName": "d[s104367096]"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>100){
        nObject.put("priceText",priceText/10.0)
        nObject.put("salesAmount",sellCount*priceText/10.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))

    println("乐淘淘鞋服老店")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "shopName": "乐淘淘鞋服老店"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>100){
        nObject.put("priceText",priceText-100.0)
        nObject.put("salesAmount",sellCount*(priceText-100.0))
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))

    println("小巴黎潮包")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "shopName": "小巴黎潮包"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>100){
        nObject.put("priceText",priceText-40.0)
        nObject.put("salesAmount",sellCount*(priceText-40.0))
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))*/



    /*println("粉色的小猪佩奇")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "shopName": "粉色的小猪佩奇"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>100){
        nObject.put("priceText",99.0)
        nObject.put("salesAmount",sellCount*99.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))


    println("DLL品牌都市店")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "shopName": "DLL品牌都市店"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>1000){
        nObject.put("priceText",priceText/10.0)
        nObject.put("salesAmount",sellCount*priceText/10.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))

    println("沙沙的店老店")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "shopName": "沙沙的店老店"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>1000){
        nObject.put("priceText",priceText/10.0)
        nObject.put("salesAmount",sellCount*priceText/10.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))

    println("MissMee OnlineStudio 小众轻奢定制店")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "shopName": "MissMee OnlineStudio 小众轻奢定制店"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>100){
        nObject.put("priceText",99.0)
        nObject.put("salesAmount",sellCount*99.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))


    println("99")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "terms": {
        |      "good_id": [
        |        "621921617283",
        |"622714707851",
        |"623491765736",
        |"623186420100",
        |"620160331369",
        |"621972372649",
        |"623916963423",
        |"621713420219",
        |"623458069169",
        |"622585775282",
        |"622273381547",
        |"622543780362",
        |"623413632496",
        |"622423602271",
        |"622400068064",
        |"623376582471",
        |"621924957412",
        |"623166585123",
        |"622895485598",
        |"622935272355",
        |"622849581493",
        |"623681118229",
        |"623336993820",
        |"623201687096",
        |"615991744569",
        |"607586417458",
        |"622427314298",
        |"623611494505",
        |"622656990783",
        |"623300018062",
        |"622149957571",
        |"624323635856",
        |"623479796881",
        |"622961960980",
        |"621898728168",
        |"623652149892",
        |"622230501284",
        |"623763773143"
        |      ]
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>99.0){
        nObject.put("priceText",99.0)
        nObject.put("salesAmount",sellCount*99.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))


    println("419")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "terms": {
        |      "good_id": [
        |        "623618002544"
        |      ]
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>419.0){
        nObject.put("priceText",419.0)
        nObject.put("salesAmount",sellCount*419.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))


    println("279")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "terms": {
        |      "good_id": [
        |        "621779952750",
        |        "622360654042"
        |      ]
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>279.0){
        nObject.put("priceText",279.0)
        nObject.put("salesAmount",sellCount*279.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))

    println("188")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "terms": {
        |      "good_id": [
        |        "623006323311"
        |      ]
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>188.0){
        nObject.put("priceText",188.0)
        nObject.put("salesAmount",sellCount*188.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))

    println("499")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "terms": {
        |      "good_id": [
        |        "622802281197"
        |      ]
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>499.0){
        nObject.put("priceText",499.0)
        nObject.put("salesAmount",sellCount*499.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))

    println("399")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "terms": {
        |      "good_id": [
        |        "623623162250",
        |        "623681879839"
        |      ]
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>399.0){
        nObject.put("priceText",399.0)
        nObject.put("salesAmount",sellCount*399.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))


    println("29")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "terms": {
        |      "good_id": [
        |        "623290780748"
        |      ]
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>29.0){
        nObject.put("priceText",29.0)
        nObject.put("salesAmount",sellCount*29.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))

    println("45")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "terms": {
        |      "good_id": [
        |        "619680296893"
        |      ]
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>45.0){
        nObject.put("priceText",45.0)
        nObject.put("salesAmount",sellCount*45.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))


    println("87")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "terms": {
        |      "good_id": [
        |        "622705023387"
        |      ]
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>87.0){
        nObject.put("priceText",87.0)
        nObject.put("salesAmount",sellCount*87.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))

    println("338")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "terms": {
        |      "good_id": [
        |        "621540048461"
        |      ]
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>338.0){
        nObject.put("priceText",338.0)
        nObject.put("salesAmount",sellCount*338.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))

    println("500")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "terms": {
        |      "good_id": [
        |        "623055156879"
        |      ]
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>500.0){
        nObject.put("priceText",500.0)
        nObject.put("salesAmount",sellCount*500.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))

    println("1580")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "terms": {
        |      "good_id": [
        |        "621115350715"
        |      ]
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>1580.0){
        nObject.put("priceText",1580.0)
        nObject.put("salesAmount",sellCount*1580.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))*/


    /*println("COCO 法国代购")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "shopName": "COCO 法国代购"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>100){
        nObject.put("priceText",priceText/2.0)
        nObject.put("salesAmount",sellCount*priceText/2.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))


    println("名衣全球贸易")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "shopName": "名衣全球贸易"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>1000){
        nObject.put("priceText",priceText-1000.0)
        nObject.put("salesAmount",sellCount*(priceText-1000.0))
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))


    println("三三驾到 好物严选")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "shopName": "三三驾到 好物严选"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>3000){
        nObject.put("priceText",3000.0)
        nObject.put("salesAmount",sellCount*3000.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))


    println("小天使在欧洲")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "shopName": "小天使在欧洲"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>3000){
        nObject.put("priceText",3000.0)
        nObject.put("salesAmount",sellCount*3000.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))


    println("LAFILLA超人店")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "shopName": "LAFILLA超人店"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>99){
        nObject.put("priceText",99.0)
        nObject.put("salesAmount",sellCount*99.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))

    println("d[s475802953]")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "shopName": "d[s475802953]"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>3000.0){
        nObject.put("priceText",3000.0)
        nObject.put("salesAmount",sellCount*3000.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))

    println("你U哥的店")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "shopName": "你U哥的店"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>997.0){
        nObject.put("priceText",997.0)
        nObject.put("salesAmount",sellCount*997.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))


    println("Xiny 手作店")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "shopName": "Xiny 手作店"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>99.0){
        nObject.put("priceText",99.0)
        nObject.put("salesAmount",sellCount*99.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))

    println("梔南齋")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "shopName": "梔南齋"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>99.0){
        nObject.put("priceText",99.0)
        nObject.put("salesAmount",sellCount*99.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))

    println("007果业")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "shopName": "007果业"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>99.0){
        nObject.put("priceText",99.0)
        nObject.put("salesAmount",sellCount*99.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))

    println("跃汇玲特摄玩具店")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "shopName": "跃汇玲特摄玩具店"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>85.0){
        nObject.put("priceText",85.0)
        nObject.put("salesAmount",sellCount*85.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))


    println("樱花奶奶家")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "shopName": "樱花奶奶家"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>100.0){
        nObject.put("priceText",priceText/100.0)
        nObject.put("salesAmount",sellCount*priceText/100.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))

    println("Lone")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "shopName": "Lone"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>50.0){
        nObject.put("priceText",50.0)
        nObject.put("salesAmount",sellCount*50.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))

    println("发状元正品百年工厂")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "shopName": "发状元正品百年工厂"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>50.0){
        nObject.put("priceText",50.0)
        nObject.put("salesAmount",sellCount*50.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))

    println("恒杰果业")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "shopName": "恒杰果业"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>100.0){
        nObject.put("priceText",priceText/100.0)
        nObject.put("salesAmount",sellCount*priceText/100.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))

    println("蛋婶儿滴杂货铺")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "shopName": "蛋婶儿滴杂货铺"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>100.0){
        nObject.put("priceText",priceText/100.0)
        nObject.put("salesAmount",sellCount*priceText/100.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))


    println("全球好物泰国溯源站")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "shopName": "全球好物泰国溯源站"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>99.0){
        nObject.put("priceText",99.0)
        nObject.put("salesAmount",sellCount*99.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))


    println("泰国好物溯源")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "shopName": "泰国好物溯源"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>99.0){
        nObject.put("priceText",99.0)
        nObject.put("salesAmount",sellCount*99.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))


    println("芊语芊味")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "shopName": "芊语芊味"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>25.0){
        nObject.put("priceText",25.0)
        nObject.put("salesAmount",sellCount*25.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))


    println("食野一族")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "shopName": "食野一族"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>92.0){
        nObject.put("priceText",92.0)
        nObject.put("salesAmount",sellCount*92.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))

    println("燃力士减脂集中营")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "shopName": "燃力士减脂集中营"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>10.0){
        nObject.put("priceText",priceText/10.0)
        nObject.put("salesAmount",sellCount*priceText/10.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))

    println("肉妈原创美肤馆")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "shopName": "肉妈原创美肤馆"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>99.0){
        nObject.put("priceText",99.0)
        nObject.put("salesAmount",sellCount*99.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))


    println("中国仙人联盟")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "shopName": "中国仙人联盟"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>25.0){
        nObject.put("priceText",25.0)
        nObject.put("salesAmount",sellCount*25.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))


    println("种花王大爷")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "shopName": "种花王大爷"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>10.0){
        nObject.put("priceText",priceText/10.0)
        nObject.put("salesAmount",sellCount*priceText/10.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))

    println("欣然多肉园艺")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "shopName": "欣然多肉园艺"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>10.0){
        nObject.put("priceText",priceText/10.0)
        nObject.put("salesAmount",sellCount*priceText/10.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))

    println("云裳园艺")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "shopName": "云裳园艺"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>100.0){
        nObject.put("priceText",priceText/100.0)
        nObject.put("salesAmount",sellCount*priceText/100.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))


    println("海蒂的花园 成都总店")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "shopName": "海蒂的花园 成都总店"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>10.0){
        nObject.put("priceText",priceText/10.0)
        nObject.put("salesAmount",sellCount*priceText/10.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))

    println("起名易学世家")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "shopName": "起名易学世家"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>10.0){
        nObject.put("priceText",priceText/2.0)
        nObject.put("salesAmount",sellCount*priceText/2.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))


    println("《包子大联盟》")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "shopName": "《包子大联盟》"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>49.0){
        nObject.put("priceText",49.0)
        nObject.put("salesAmount",sellCount*49.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))


    println("非常品网")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "shopName": "非常品网"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>100.0){
        nObject.put("priceText",1.0)
        nObject.put("salesAmount",sellCount*1.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))


    println("三饭")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "shopName": "三饭"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>100.0){
        nObject.put("priceText",1.0)
        nObject.put("salesAmount",sellCount*1.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))


    println("1")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "terms": {
        |      "good_id": [
        |        "598917886424",
        |"624160843616",
        |"607477501345",
        |"611430581715",
        |"619844354072",
        |"618717564686",
        |"596748260030",
        |"611415739417",
        |"615370222184",
        |"39607654283",
        |"556643680310",
        |"22508816565",
        |"597815070618",
        |"619342775855"
        |      ]
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>1.0){
        nObject.put("priceText",1.0)
        nObject.put("salesAmount",sellCount*1.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))


    println("5")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "terms": {
        |      "good_id": [
        |        "616898273094",
        |"609903155409"
        |      ]
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>5.0){
        nObject.put("priceText",5.0)
        nObject.put("salesAmount",sellCount*5.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))


    println("10")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "terms": {
        |      "good_id": [
        |        "560325322554"
        |      ]
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>10.0){
        nObject.put("priceText",10.0)
        nObject.put("salesAmount",sellCount*10.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))


    println("16.8")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "terms": {
        |      "good_id": [
        |        "619577347980"
        |      ]
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>16.8){
        nObject.put("priceText",16.8)
        nObject.put("salesAmount",sellCount*16.8)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))

    println("25")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "terms": {
        |      "good_id": [
        |        "619047172286"
        |      ]
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>25.0){
        nObject.put("priceText",25.0)
        nObject.put("salesAmount",sellCount*25.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))

    println("30")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "terms": {
        |      "good_id": [
        |        "620720470596"
        |      ]
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>30.0){
        nObject.put("priceText",30.0)
        nObject.put("salesAmount",sellCount*30.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))

    println("32")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "terms": {
        |      "good_id": [
        |        "587370321766"
        |      ]
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>32.0){
        nObject.put("priceText",32.0)
        nObject.put("salesAmount",sellCount*32.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))


    println("49")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "terms": {
        |      "good_id": [
        |        "617037021309",
        |"616414837075"
        |      ]
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>49.0){
        nObject.put("priceText",49.0)
        nObject.put("salesAmount",sellCount*49.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))


    println("50")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "terms": {
        |      "good_id": [
        |        "602338240923",
        |"622434115021"
        |      ]
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>50.0){
        nObject.put("priceText",50.0)
        nObject.put("salesAmount",sellCount*50.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))


    println("80")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "terms": {
        |      "good_id": [
        |        "621136903444"
        |      ]
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>80.0){
        nObject.put("priceText",80.0)
        nObject.put("salesAmount",sellCount*80.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))


    println("99")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "terms": {
        |      "good_id": [
        |        "623216591146",
        |"624291171516",
        |"622977058502",
        |"621903624252",
        |"623589726253",
        |"622377216469",
        |"624079810279"
        |      ]
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>99.0){
        nObject.put("priceText",99.0)
        nObject.put("salesAmount",sellCount*99.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))
*/






















    /*println("8度定制店")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "shopName": "8度定制店"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>100){
        nObject.put("priceText",99.0)
        nObject.put("salesAmount",sellCount*99.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))


    println("主妍原创设计师品牌")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "shopName": "主妍原创设计师品牌"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>100){
        nObject.put("priceText",99.0)
        nObject.put("salesAmount",sellCount*99.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))

    println("揽街旗舰店")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "shopName": "揽街旗舰店"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>100){
        nObject.put("priceText",priceText-100.0)
        nObject.put("salesAmount",sellCount*(priceText-100.0))
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))

    println("cj vvvip shop")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "shopName": "cj vvvip shop"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>100){
        nObject.put("priceText",99.0)
        nObject.put("salesAmount",sellCount*99.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))


    println("TIOR家居生活馆")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "shopName": "TIOR家居生活馆"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>100){
        nObject.put("priceText",88.0)
        nObject.put("salesAmount",sellCount*88.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))

    println("蔻妮茜品牌店")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "shopName": "蔻妮茜品牌店"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>100){
        nObject.put("priceText",99.0)
        nObject.put("salesAmount",sellCount*99.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))

    println("奢卢士")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "shopName": "奢卢士"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>100){
        nObject.put("priceText",99.0)
        nObject.put("salesAmount",sellCount*99.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))

    println("珍琦珠宝商")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "shopName": "珍琦珠宝商"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>100){
        nObject.put("priceText",80.0)
        nObject.put("salesAmount",sellCount*80.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))

    println("CollarShang米娅定制")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "shopName": "CollarShang米娅定制"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>100){
        nObject.put("priceText",99.0)
        nObject.put("salesAmount",sellCount*99.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))

    println("乐享健康运动生活馆")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "shopName": "乐享健康运动生活馆"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>100){
        nObject.put("priceText",priceText/2)
        nObject.put("salesAmount",sellCount*priceText/2)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))

    println("d[s72655913]")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "shopName": "d[s72655913]"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>100){
        nObject.put("priceText",99.0)
        nObject.put("salesAmount",sellCount*99.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))

    println("九久久的小店")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "shopName": "九久久的小店"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>100){
        nObject.put("priceText",88.0)
        nObject.put("salesAmount",sellCount*88.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))

    println("迁玺子哥")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "shopName": "迁玺子哥"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>100){
        nObject.put("priceText",88.0)
        nObject.put("salesAmount",sellCount*88.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))

    println("秋姐发发发")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "shopName": "秋姐发发发"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>100){
        nObject.put("priceText",88.0)
        nObject.put("salesAmount",sellCount*88.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))

    println("她及其他/TAGKITA")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "brandName_cn": "她及其他/TAGKITA"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      if (priceText>300){
        nObject.put("priceText",99.0)
        nObject.put("salesAmount",sellCount*99.0)
      }
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))

    println("617340233120")
    sc.esJsonRDD(index,
      """
        |{
        |  "query": {
        |    "match_phrase": {
        |      "good_id": "617340233120"
        |    }
        |  }
        |}
      """.stripMargin).values.map(lines=>{
      val nObject: JSONObject = JSON.parseObject(lines)
      //大于100变成99
      val priceText: Double = nObject.getDouble("priceText")

      val sellCount = nObject.getInteger("sellCount")
      nObject.put("priceText",140.0)
      nObject.put("salesAmount",sellCount*140.0)
      nObject
    }).saveToEs(index, Map("es.mapping.id" -> "good_id"))*/


    sc.stop()
  }

}
